<?php
   require(dirname(__FILE__).'/global.php');
   require(ROOT.'/admin/isLogin.php');      
   require(ROOT.'/include/xml.class.php'); 
   
   $submit = $_POST['submit'];
   $xmlPath = ROOT.'/common.xml';
   $xml = new SimpleXMLUtil($xmlPath);
   if(isset($submit))
   {
       $profile = $_POST['profile'];
       if(empty($profile))
       {
           $smarty->assign('tip','协议不能为空');
       }
       else
       {
           $xml->setElementValue('Profile',$profile);
           $xml->save();
           $smarty->assign('tip','更新成功');
       }
   }
   $profile = $xml->getElementValue('Profile');
   $smarty->assign('profile',$profile);
   $smarty->display('protocol.html');
   $db->close();
?>
